var db = require("../models");
var sequelize = db.sequelize;

var Role =db['role'];
var role_id = "aabbcc-aa-11-22-dd";
var role_role = "role:admin"
Role.sync().then(function() {
    return Role.create({
        id: role_id,
        role: role_role
        }
    )
}).then(function() {
    return Role
            .findOne()
            .then(function(role) {
                console.log(role.get("id"));
                console.log(role.get("role"));
            });
}).then(function() {
    return Role.findOne()
            .then(function(role) {
                Role.destroy({
                    where: {
                        id: role_id
                    }
                })
            })
}).catch(function(err) {
    console.error(err);
});
